package com.apexedu.portal.util;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * 青海迎新配置文件读取类
 * Created by ly on 2015/8/18.
 */
public class YxqhProUtil {

    public static Map<String, String> map = new HashMap<String, String>();

    public static String get(String key) {
        try {
            String value = map.get(key);
            if (value == null) {
                Properties props = new Properties();
                ClassLoader cl = Thread.currentThread().getContextClassLoader();
                InputStream stream = cl.getResourceAsStream("yxqh.properties");
                props.load(stream);
                value = props.getProperty(key);
                map.put(key, value);
            }
            return value;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
